﻿<%@ Page Language="C#" MasterPageFile="~/Template/Site_Main.Master" AutoEventWireup="true"
    CodeBehind="studentinfoadd_contrast.aspx.cs" Inherits="RegisterationSystem.Space_Education.studentinfoadd_contrast" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script src="../Framework/Calendar.js" type="text/javascript"></script>
    <script src="../Framework/function.js" type="text/javascript"></script>
    <%--        <link href="../Framework/EasyUI/themes/default/easyui.css" rel="stylesheet" type="text/css" />
        <link href="../Styles/style.css" rel="stylesheet" type="text/css" />
        <script src="../Framework/jquery.min.js" type="text/javascript"></script>
        <script src="../Framework/jquery.floatDiv.js" type="text/javascript"></script>
        <script src="../Framework/EasyUI/jquery.easyui.min.js" type="text/javascript"></script>
        <script src="../Framework/EasyUI/easyloader.js" type="text/javascript"></script>
        <script src="../Framework/EasyUI/locale/easyui-lang-zh_CN.js" type="text/javascript"></script>
        <script src="../Framework/IDCardVer.js" type="text/javascript"></script>--%>
    <script type="text/javascript">
          <!--
        $(function () {
            //初始化隐藏层
            $('#plasschool').dialog({
                closed: true
            });

            //初始化企业用户数据列表控件
            $("#dg").datagrid({
                idField: "id",      //标识字段,主键
                url: "../SyncService/GetDataList.ashx?action=getstudentctinfo",
                queryParams: { "where": "1=1" },
                pagination: true,   //是否开启分页
                rownumbers: true,   //行号
                pageSize: 10,
                pageNumber: 1,
                columns: [[
                            { field: 'ck', checkbox: true },
                            { field: 'ctname', title: '学生姓名', width: 100, align: 'center' },
                            { field: 'ctsex', title: '性别', width: 60, align: 'center', formatter: function (value, row) {
                                if (value) {
                                    return "女";
                                } else {
                                    return "男";
                                }
                            }
                            },
                            { field: 'ctbirthday', title: '出生日期', width: 150, align: 'center', formatter: function (value, row, index) {
                                var temp = new Array();
                                temp = value.split(" ");
                                return temp[0];
                            }
                            },
                            { field: 'ctguardname', title: '户主姓名', width: 100, align: 'center' },
                            { field: 'ctguardrelation', title: '与户主关系', width: 180, align: 'center' },
                            { field: 'ctaddress', title: '户籍', width: 350, align: 'center' },
                         ]],
                onClickRow: function (index, row) {
                    if (editIndex != index) {
                        if (endEditing()) {
                            $('#dg').datagrid('beginEdit', index);
                            editIndex = index;
                        } else {
                            $('#dg').datagrid('selectRow', editIndex);
                        }
                    }
                }
            })
        });
        var editIndex = undefined;
        function endEditing() {
            if (editIndex == undefined) { return true }
            if ($('#dg').datagrid('validateRow', editIndex)) {
                var ed = $('#dg').datagrid('getEditor', { index: editIndex, field: 'id' });
                //var productname = $(ed.target).combobox('getText');
                //$('#tt').datagrid('getRows')[editIndex]['productname'] = productname;
                $('#dg').datagrid('endEdit', editIndex);
                editIndex = undefined;
                return true;
            } else {
                return false;
            }
        }
        //-->
        //删除学生
        function DelStus() {
            //修改未编辑完的行
            $('#dg').datagrid('endEdit', editIndex);
            //id集合
            var ids = "";
            //获取选择集合
            var rows = $('#dg').datagrid('getSelections');
            //是否选中行
            if (rows.length == 0) {
                alert("请选择行");
                return;
            }
            //遍历选择行
            for (var i = 0; i < rows.length; i++) {
                ids += rows[i].id + ",";
            }
            //alert(ids);
            $.messager.confirm('提示', '确认删除？', function (r) {
                if (r) {
                    $.post(location.href, { "action": "del", "id": ids }, function (data) {
                        $.messager.alert("消息提示", "删除成功！");
                        $('#dg').datagrid('reload');
                    });
                }
            });
        }
        //验证
        function submitForm() {
            //验证必填项
            if (!$("#aspnetForm").form("validate")) {
                return false;
            }
//            if ($("#txtname").val() == "") {
//                alert("姓名不能为空！");
//                return (false);
//            }
//            if ($("#txtPermanentAddress").val() == "") {
//                alert("户籍不能为空！");
//                return (false);
//            }
//            if ($("#Birthday").datetimebox('getValue') == "") {
//                alert("出生日期不能为空！");
//                return (false);
//            }
//            if ($("#txtFirstGuardianName").val() == "") {
//                alert("户主姓名不能为空！");
//                return (false);
//            }
//            if ($("#txtFirstRelationship").val() == "") {
//                alert("关系不能为空！");
//                return (false);
//            }

        }
        function SearchList() {
            var where = "";
            where += $("#txtsearchname").val() + ","; //姓名
            $('#dg').datagrid({ url: "../SyncService/GetDataList.ashx?action=getstudentctinfo", queryParams: { "where": where} });
            $('#dg').datagrid('reload');
        }
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="Place_Local" runat="server">
    <div class="localTitle">
        <a>学生对比信息录入</a>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div class="loadheight">
        <table width="100%%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td bgcolor="#FFFFFF">
                    <table width="100%%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td>
                                <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                </table>
                            </td>
                        </tr>
                    </table>
                    <table width="100%%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td class="cen_R_top cen_foat">
                                <strong>对比信息录入</strong>
                            </td>
                        </tr>
                        <tr>
                            <td class="cen_R_dh">
                                <strong>学生信息</strong>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                <div style="margin-top: 5px;">
                                </div>
                                <table width="788px" border="0" cellpadding="3" cellspacing="1" bgcolor="#dddfe0">
                                    <tr>
                                        <td width="100" height="20" align="center" bgcolor="#FFFFFF">
                                            学生姓名
                                        </td>
                                        <td width="180" bgcolor="#FFFFFF" colspan="2">
                                            <input type="text" id="txtname" style="width: 130px;" class="easyui-validatebox"
                                                runat="server" data-options="required:true" maxlength="20" />
                                        </td>
                                        <td width="65" align="center" bgcolor="#FFFFFF">
                                            性别
                                        </td>
                                        <td width="60" align="left" bgcolor="#FFFFFF" colspan="2">
                                            <asp:DropDownList ID="ddlsex" runat="server" class="easyui-combobox" data-options="required:true,editable:false">
                                                <asp:ListItem Value="0">男</asp:ListItem>
                                                <asp:ListItem Value="1">女</asp:ListItem>
                                            </asp:DropDownList>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="20" align="center" bgcolor="#FFFFFF">
                                            户籍地址
                                        </td>
                                        <td bgcolor="#FFFFFF" align="left" colspan="2">
                                            <input type="text" id="txtPermanentAddress" runat="server" style="width: 300px;"
                                                maxlength="1000" class="easyui-validatebox" data-options="required:true" />
                                        </td>
                                        <td height="20" align="center" bgcolor="#FFFFFF">
                                            出生日期
                                        </td>
                                        <td align="left" bgcolor="#FFFFFF">
                                            <input type="text" id="Birthday" runat="server" style="width: 120px; height: 20px;"
                                                class="easyui-datebox" data-options="required:true,editable:false" />
                                        </td>
                                    </tr>
                                </table>
                                <div style="margin-top: 5px">
                                </div>
                                <table width="100%%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td class="cen_R_dh">
                                            <strong>监护人（家长）信息</strong>
                                        </td>
                                    </tr>
                                </table>
                                <div style="margin-top: 5px">
                                </div>
                                <table width="788px" border="0" cellspacing="1" cellpadding="3" bgcolor="#dddfe0">
                                    <tr>
                                        <td width="100" bgcolor="#FFFFFF">
                                            &nbsp;
                                        </td>
                                        <td width="120" align="center" bgcolor="#FFFFFF">
                                            姓名
                                        </td>
                                        <td width="120" align="center" bgcolor="#FFFFFF">
                                            关系
                                        </td>
                                    </tr>
                                    <tr>
                                        <td align="center" bgcolor="#FFFFFF">
                                            户主信息
                                        </td>
                                        <td align="center" bgcolor="#FFFFFF">
                                            <input type="text" id="txtFirstGuardianName" style="width: 150px;" class="easyui-validatebox "
                                                runat="server" data-options="required:true" maxlength="10" />
                                        </td>
                                        <td align="center" bgcolor="#FFFFFF">
                                            <input type="text" id="txtFirstRelationship" style="width: 150px;" class="easyui-validatebox "
                                                runat="server" data-options="required:true" maxlength="10" />
                                        </td>
                                    </tr>
                                </table>
                                <table width="788px" height="17" border="0" cellpadding="0" cellspacing="0">
                                    <tr>
                                        <td height="60" align="center">
                                            <asp:Button ID="btnadd" runat="server" class="anniu_big" Text="对比信息提交" OnClientClick="return submitForm();" OnClick="btnadd_Click"
                                                 />
                                            <input id="Reset1" class="anniu" type="reset" value="重置" />
                                        </td>
                                    </tr>
                                </table>
                                <table width="100%%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td class="cen_R_dh">
                                            <strong>信息查询</strong>
                                        </td>
                                    </tr>
                                </table>
                                <div style="margin-top: 5px">
                                </div>
                                <table width="788px" border="0" cellspacing="1" cellpadding="3" bgcolor="#dddfe0">
                                    <tr>
                                        <td bgcolor="#FFFFFF" style=" padding-left:10px">
                                            姓名<input type="text" id="txtsearchname" style="width: 200px; margin-left:10px" class="easyui-validatebox " maxlength="20" />
                                            <input id="search" class="anniu" type="button" value="查询" style=" margin-left:10px" onclick="SearchList();"  />
                                        </td>
                                    </tr>
                                </table>
                                <div style="height: 3px;">
                                </div>
                                <table width="100%" border="0" cellspacing="0" cellpadding="1">
                                    <tr>
                                        <td class="cen_R_dh">
                                            <strong>学生信息列表</strong>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <!-- 创建数据列表控件 -->
                                            <table id="dg" style="width: 1026px">
                                            </table>
                                            <div style="margin-top: 10px;">
                                            </div>
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                                <tr>
                                                    <td align="left">
                                                        <input type="button" name="button2" id="button1" value="删除" class="anniu" width="73"
                                                            height="27" onclick="DelStus();" />
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
</asp:Content>
